<?php 

$auth = $_SESSION['auth'];
if (empty($auth)) die('用户未登录！');

global $config;
if (!in_array($auth['id'], $config['manager']) && $city_info['user_id'] != $auth['id']) die('用户权限不够!^_^');

if (!empty($_POST)) die;

?>
<div class="container">
	<div class="row clearfix">
		<ol class="breadcrumb forum-breadcrumb">
			<li><a href="?c=forum"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
			<li class="active"><span class="glyphicon glyphicon-edit"></span> 城市设置</li>
		</ol>
	</div>
</div>
<div class="container">
	<div class="forum-add">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<h3><span class="glyphicon glyphicon-edit"></span> 城市设置</h3>
				<hr class="solid">
				<div class="col-md-11 column">
					<form id="forum_city_edit" class="form-horizontal" action="javascript:do_forum_city_edit()">
						<fieldset>
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-2 control-label">名称</label>  
								<div class="col-md-7">
									<input name="name" type="text" placeholder="城市名称" class="form-control input-md" required="" value="<?php echo $city_info['name'] ?>">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">背景图片URL</label>  
								<div class="col-md-7">
									<input name="background_url" type="text" placeholder="背景图片URL" class="form-control input-md" value="<?php echo $city_info['background_url'] ?>">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">首页图片URL</label>  
								<div class="col-md-7">
									<input name="index_img_url" type="text" placeholder="首页图片URL" class="form-control input-md" value="<?php echo $city_info['index_img_url'] ?>">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">首页图片连接</label>  
								<div class="col-md-7">
									<input name="index_img_link" type="text" placeholder="首页图片连接" class="form-control input-md" value="<?php echo $city_info['index_img_link'] ?>">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">功能选择</label>  
								<div class="col-md-7">
									<div class="checkbox"><label><input name="carousel" type="checkbox" <?php if (1 == $city_info['carousel']) echo 'checked="checked"' ?>> 首页滚动图 </label></div>
								</div>
							</div>
							<?php if(in_array($auth['id'], $config['manager'])) { ?>
							<div class="form-group">
								<label class="col-md-2 control-label">用户 ID</label>  
								<div class="col-md-7">
									<input name="user_id" type="text" placeholder="用户ID" class="form-control input-md" required="" value="<?php echo $city_info['user_id'] ?>">
								</div>
							</div>
							<?php } ?>
							<!-- token -->
							<input type="hidden" name="token" value="<?php echo get_token() ?>"/>
							<!-- Button -->
							<div class="form-group">
								<label class="col-md-2 control-label"></label>
								<div class="col-md-2">
									<button class="btn btn-primary btn-block">设置</button>
								</div>
								<div class="col-md-5">
								</div>
							</div>
						</fieldset>
					</form>	


				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

	$(document).ready(function(){
			$('li#forum_city_edit').addClass('active');
			});

		</script>
